package com.tencent.sr.iris.activity.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 *
 */
@AllArgsConstructor
@Getter
public enum UserTaskStatusEnum {
    PROGRESS((byte) 0, "进行中"),
    FINISHED((byte) 1, "已完成"),
    UNFINISHED((byte) 2, "未完成"),
    LIMITED((byte) 3, "超上限"),
    ;

    private final byte code;
    private final String desc;

    public static UserTaskStatusEnum getByCode(byte code) {
        for (UserTaskStatusEnum staff : UserTaskStatusEnum.values()) {
            if (staff.getCode() == code) {
                return staff;
            }
        }
        return null;
    }
}
